package com.juyu.reader.author.scheduled;

import java.util.Calendar;
import java.util.Date;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;


@Component
public class ScheduledTaskManager {
	// Logger logger = Logger.getLogger(ScheduledTaskManager.class);
	// @Autowired
	// private CountTaskService countTaskService;
	//
	// /**
	// * 自动定时统计数据，时间每天凌晨1:00
	// */
	// @Scheduled(cron = "0 0 1 * * ? ")
	// public void autoCountTask() {
	// // 获取前一天日期
	// Calendar cal = Calendar.getInstance();
	// cal.setTime(new Date());
	// cal.add(Calendar.DAY_OF_MONTH, -1);
	// logger.info("autoCountTask begin==" + DateUtil.formatDate(cal.getTime())
	// + "==");
	// countTaskService.executeCountTask(cal.getTime(),0);
	// cal.setTime(new Date());
	// cal.add(Calendar.DAY_OF_MONTH, -1);
	// logger.info("autoCountTask end==" + DateUtil.formatDate(cal.getTime()) +
	// "==");
	// }
}
